<?php

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/

$factory->define(App\Models\User::class, function (Faker\Generator $faker) {
    return [
        'name'           => $faker->name,
        'email'          => $faker->safeEmail,
        'password'       => bcrypt(str_random(10)),
        'remember_token' => str_random(10),
    ];
});

$factory->define(App\Models\ArticleCategory::class, function (Faker\Generator $faker) {
    return [
        'name'      => $faker->word . mt_rand(),
        'parent_id' => 0,
    ];
});

$factory->define(App\Models\Article::class, function (Faker\Generator $faker) {
    $arr = [32, 33, 34, 35, 36, 37];
    return [
        'title'                => $faker->word . mt_rand(),
        'article_category_id' => $arr[mt_rand(0, 5)],
        'content'             => $faker->text(500),
    ];
});

$factory->define(App\Models\ProductCategory::class, function (Faker\Generator $faker) {
    return [
        'name'      => $faker->word . mt_rand(),
        'parent_id' => 0,
    ];
});

$factory->define(App\Models\Brand::class, function (Faker\Generator $faker) {
    return [
        'name'  => $faker->word . mt_rand(),
        'brief' => $faker->text(200),
    ];
});